
using Grpc.Net.Client;
using Microsoft.AspNetCore.Hosting; 
using Microsoft.Extensions.Hosting;
using SHKF.B2C.BaseHosted;
using SHKF.B2C.Hosted;
using SHKF.B2C.SaleServices.Protos;
using System;
using static SHKF.B2C.SaleServices.Protos.GSaleService;

namespace SHKF.B2C.YouZanYun.Service
{
    public class Program
    {
        public static void Main(string[] args)
        {
            try
            {
                Sale();

                CreateHostBuilder(args)
                .UseRunJson("")
                .Build().Run();
            }
            catch (System.Exception ex)
            {

                throw ex;
            }

        }

        private static void Sale()
        {
            //AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            //GrpcChannel channel = GrpcChannel.ForAddress("http://localhost:5002");

            //SaleRequest request = new SaleRequest();
            //request.SN = 100;
            //new GSaleServiceClient(channel).Save(request);

        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
 
}
